package com.atguigu.springcloud.service;

import com.atguigu.springcloud.entities.Dept;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther:
 * @Description:
 * @Date: 2019/11/22 10:41
 */
//@FeignClient(value = "MICROSERVICECLOUD-DEPT")
//@FeignClient(value = "MICROSERVICECLOUD-DEPT", fallbackFactory = DeptClientServiceFallbackFactory.class)
@FeignClient(value = "MICROSERVICECLOUD-CONFIG-DEPT-CLIENT", fallbackFactory = DeptClientServiceFallbackFactory.class)
@RequestMapping(value = "/dept")
public interface DeptClientService {

    @PostMapping("/add")
    public boolean add(@RequestBody Dept dept);

    @GetMapping("/get/{id}")
    public Dept get(@PathVariable("id") Long id);

    @GetMapping("/list")
    public List<Dept> list();
}
